   create external table jms_dm.dm_daily_waybill_weight_difference_detail_dt (
  waybill_no string comment'运单号',
  subordinate_agent_id string comment'所属代理区ID',
  subordinate_agent_code string COMMENT'所属代理区code',
  subordinate_agent_name string COMMENT'所属代理区',
  city_id string COMMENT'城市ID',
  city_desc string COMMENT'城市名字',
  code string COMMENT'网点code',
  name string COMMENT'网点名字',
  settlement_weight decimal(16,2) COMMENT'结算重量',
  first_org_code string COMMENT'机构一code',
  first_org_name string comment'机构一名字',
  first_weight decimal(16,2)  COMMENT'机构一重量',
  first_volume_weight decimal(16,2) COMMENT '机构一体积重',
  second_org_code string COMMENT'机构二code',
  second_org_name string COMMENT'机构二名字',
  second_weight decimal(16,2) COMMENT'机构二重量',
  second_volume_weight decimal(16,2) COMMENT'机构二体积重',
  third_org_code string COMMENT'机构三code',
  third_org_name string COMMENT'机构三名字' ,
  third_weight decimal(16,2) COMMENT'机构三重量',
  third_volume_weight decimal(16,2) COMMENT'机构三体积重' ,
  input_date string COMMENT'运单录入日期',
  is_refund int comment'运单状态 1:已退件2:已转寄3:未退件4:退转件',
  first_scan_type string comment '机构1扫描类型',
  second_scan_type string comment '机构2扫描类型',
  third_scan_type string comment '机构3扫描类型'
)
    COMMENT  '称重差异明细'
    PARTITIONED BY ( dt STRING COMMENT '日期')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_dm.db/external/dm_daily_waybill_weight_difference_detail_dt'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );
 --修改语句
 -- alter table jms_dm.dm_daily_waybill_weight_difference_detail_dt add columns (is_refund string comment'运单状态 1:已退件2:已转寄3:未退件4:退转件') cascade ;
 alter table jms_dm.dm_daily_waybill_weight_difference_detail_dt add columns (
             is_reweigh int comment '是否重复称重',
             sign_network_code string comment '签收网点code',
             sign_network_name string comment '签收网点',
             destination_name string comment '目的地'
 ) cascade ;

    create external table jms_tmp.dm_daily_waybill_weight_difference_detail_new_dt (
   waybill_no string comment'运单号',
   subordinate_agent_id string comment'所属代理区ID',
   subordinate_agent_code string COMMENT'所属代理区code',
   subordinate_agent_name string COMMENT'所属代理区',
   city_id string COMMENT'城市ID',
   city_desc string COMMENT'城市名字',
   code string COMMENT'网点code',
   name string COMMENT'网点名字',
   settlement_weight decimal(16,2) COMMENT'结算重量',
   first_org_code string COMMENT'机构一code',
   first_org_name string comment'机构一名字',
   first_weight decimal(16,2)  COMMENT'机构一重量',
   first_volume_weight decimal(16,2) COMMENT '机构一体积重',
   second_org_code string COMMENT'机构二code',
   second_org_name string COMMENT'机构二名字',
   second_weight decimal(16,2) COMMENT'机构二重量',
   second_volume_weight decimal(16,2) COMMENT'机构二体积重',
   third_org_code string COMMENT'机构三code',
   third_org_name string COMMENT'机构三名字' ,
   third_weight decimal(16,2) COMMENT'机构三重量',
   third_volume_weight decimal(16,2) COMMENT'机构三体积重' ,
   input_date string COMMENT'运单录入日期',
   is_refund int comment'运单状态 1:已退件2:已转寄3:未退件4:退转件',
   first_scan_type string comment '机构1扫描类型',
   second_scan_type string comment '机构2扫描类型',
   third_scan_type string comment '机构3扫描类型'
 )
     COMMENT  '称重差异明细中间表'
     PARTITIONED BY ( dt STRING COMMENT '日期')
     STORED AS PARQUET
     LOCATION '/dw/hive/jms_tmp.db/external/dm_daily_waybill_weight_difference_detail_new_dt'
     TBLPROPERTIES (
         'discover.partitions' = 'false',
         'parquet.column.index.access' = 'true'
         );
          alter table jms_dm.dm_daily_waybill_weight_difference_detail_new_dt add columns (
             is_reweigh int comment '是否重复称重',
             sign_network_code string comment '签收网点code',
             sign_network_name string comment '签收网点',
             destination_name string comment '目的地'
          ) cascade ;

